<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/mod2016/include/taglib.jsp" %>
<html>
<head>
    <meta charset="UTF-8">
    <%@ include file="/WEB-INF/views/mod2016/include/head.jsp" %>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/plat2016/public/js/My97DatePicker/skin/WdatePicker.css">
    <%--<link rel="stylesheet" type="text/css" href="${ctxStatic}/plat2016/public/css/jquery_dialog.css">--%>
    <%--<link rel="stylesheet" type="text/css" href="${ctxStatic}/plat2016/public/js/jquery-ztree/3.5.12/css/zTreeStyle/metro.css">--%>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/plat2016/public/css/datecenter.css">
    <script type="text/javascript" src="${ctxStatic}/plat2016/public/js/My97DatePicker/WdatePicker.js"></script>
    <%--<script type="text/javascript" src="${ctxStatic}/plat2016/public/js/jquery_dialog.js"></script>--%>
    <script type="text/javascript" src="${ctxStatic}/plat2016/public/js/echarts.js"></script>
    <script type="text/javascript" src="${ctxStatic}/plat2016/public/js/template.min.js"></script>
    <script type="text/javascript" src="${ctxStatic}/plat2016/public/js/hui.common.js?v=111"></script>
    <title>数据中心</title>
</head>

<body class="bg-gray">
<jsp:include page="/pub/include/top"/>

<div class=" cbox clearfix mgt-10">
    <jsp:include page="/pub/include/nav?navCode=${report.menuCode==null?'configList':report.menuCode}"/>
    <div class="con-wr mgb-10  fr">
        <jsp:include page="/pub/include/bread?navCode=configList"/>

        <c:if test="${report.menuCode==null}">
            <jsp:include page="/pub/include/threeNav?menuName=${report.reportName}" />
        </c:if>
        <c:if test="${report.menuCode!=null}">
            <jsp:include page="/pub/include/threeNav?navCode=${report.menuCode}" />
        </c:if>

        <div class="searchbar searchbar-n bg-white ">
            <form:form id="searchForm" action="${ctx}/report/produce/img?reportId=${report.reportId}" method="post">
                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>

                <table border="0">
                    <c:forEach items="${report.reportConfigIns}" var="reportConfigIn" varStatus="status">
                    <c:choose>
                    <c:when test="${status.index%3==0 }">
                    <tr>
                        </c:when>
                        </c:choose>

                        <div class="fl mgb-10 mgr-20">
                            <span class="fl  w100-tr">${reportConfigIn.itemName }：</span>
                                <%--文本--%>
                            <c:if test="${reportConfigIn.itemType eq '0' }">
                                <input type="text" name="${reportConfigIn.itemCode}" class="w-input162"
                                       value="${reportConfigIn.paramValue }"/>
                            </c:if>
                                <%--数字--%>
                            <c:if test="${reportConfigIn.itemType eq '1' }">
                                <input type="text" name="${reportConfigIn.itemCode }" class="w-input162 digits"
                                       value="${reportConfigIn.paramValue }"/>
                            </c:if>
                                <%--静态字典数据--%>
                            <c:if test="${reportConfigIn.itemType eq '2' or reportConfigIn.itemType eq '3' or reportConfigIn.itemType eq '4'  }">
                                <select name="${reportConfigIn.itemCode}" class="w-input180" id="${reportConfigIn.itemCode}" value="${reportConfigIn.paramValue }"
                                        <c:if test="${reportConfigIn.thirdType eq '1'}">multiple="multiple" attrVal="${reportConfigIn.paramValue}"</c:if>>
                                    <option value="">请选择</option>
                                    <c:forEach items="${reportConfigIn.selectList}" var="dict">
                                        <c:choose>
                                            <c:when test="${reportConfigIn.paramValue eq  dict.value}">
                                                <option value="${dict.value }" selected="selected">${dict.label }</option>
                                            </c:when>
                                            <c:otherwise>
                                                <option value="${dict.value }">${dict.label }</option>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:forEach>
                                </select>
                            </c:if>
                                <%--日期--%>
                            <c:if test="${reportConfigIn.itemType eq '5' }">
                                <input id="${reportConfigIn.itemCode }" name="${reportConfigIn.itemCode }" value="${reportConfigIn.paramValue}"
                                       type="text" maxlength="20" class="Wdate input-n4 fl w-input162"
                                       onclick="WdatePicker({dateFmt:'${reportConfigIn.checkType}',isShowClear:false});"/>
                            </c:if>
                        </div>
                        <c:if test="${status.last}">
                        <div class="mgl-100 clear ">
                            <input type="submit" value="查询" class="btn-yellow mgl-8">
                            <input type="button" value="清空" class="btn-gray-outline mgl-10 _goReset">
                        </div>
                        </c:if>
                        </c:forEach>
                </table>
            </form:form>
        </div>

        <c:forEach items="${imgConfList}" var="icl">
            <sys:reportImg img="${icl}"></sys:reportImg>
        </c:forEach>

        <%--<jsp:include page="/WEB-INF/views/mod2016/page/data/datacenter/charts/chartsTop.jsp"/>--%>

        <c:if test="${report.tabIsShow == '1'}">
            <jsp:include page="/WEB-INF/views/mod2016/page/data/reportConf/reportDataTable.jsp"/>
        </c:if>

    </div>
</div>
</div>
<script type="text/javascript">
       //var thisName = $("select[multiple='multiple']").attr("name");
       //var thisVal =$("select[multiple='multiple']").attr("attrVal");
       //console.log("name:"+thisVal+"|"+"value:"+thisVal);
       //if(thisVal!=null && thisVal!=undefined && thisVal!=""){
       //    var words = thisVal.split(",");
       //    $("select[name='"+thisName+"']").val(words).trigger("change");
       //}
    $(function () {
        $("select[multiple='multiple']").each(function () {
            var thisId = $(this).attr("id");
            var thisVal = $(this).attr("attrVal");
            console.log("name:"+thisId+"|"+"value:"+thisVal);
            if(thisVal!=null && thisVal!=undefined && thisVal!=""){
                var words = thisVal.split(",");
                $("#"+thisId).val(words).trigger("change");
            }
        });
    });

</script>
</body>
</html>